#include<bits/stdc++.h>
using namespace std;

int t, h;
int main()
{
    cin >> t;
    while (t--)
    {
        cin >> h;
        int ret = 1;
        h -= 1;
        //记录上次减的多少
        int cnt = 1;
        while (h != 0)
        {
            if (h % (2 * cnt) == 0)
            {
                ret++;
                h -= 2 * cnt;
                cnt = 2 * cnt;
            }
            else
            {
                h -= cnt;
                ret++;
            }
        }
        cout << ret << endl;

    }
    return 0;
}